<?php
exit();
include("AllWeb.inc.php");

foreach($arrWeb as $strWeb){
	print $strWeb."\n";
	$_SERVER["DOCUMENT_ROOT"] = "/home/share/www/".$strWeb."/secure";
	/*替會員、代理商、總代理和股東加上其所有階層ID*/
	include($_SERVER["DOCUMENT_ROOT"]."/db.inc.php");

	//新增臨時總監
	$strSQL = "select ID from `bet_Member` where Account = 'DrCom'";
	if(!$RS = PMA_mysql_query($strSQL, $_ConnMaster)){
		exit("Error".PMA_mysql_error($_ConnMaster));
	}elseif(PMA_mysql_num_rows($RS) == 0){
		print "Error".$strSQL."\n";
		continue;
	}
	$Rows = PMA_mysql_fetch_object($RS);
	$intDID = $Rows -> ID;

	$strSQL = "select ID, A_Commission_MinValue as ALine, B_Commission_MinValue as BLine, C_Commission_MinValue as CLine from `bet_BetType` where LottoID = 1";
	if(!$RS = PMA_mysql_query($strSQL, $_ConnMaster)){
		exit( PMA_mysql_error($_ConnMaster));
	}
	while($Rows = PMA_mysql_fetch_object($RS)){
		$arrSQL[0] = "update `bet_Commission` set Commission = '".$Rows -> ALine."' where MemID = ".$intDID." and Bet_Type = ".$Rows -> ID." and Gamble_Type = 1";
		$arrSQL[1] = "update `bet_Commission` set Commission = '".$Rows -> BLine."' where MemID = ".$intDID." and Bet_Type = ".$Rows -> ID." and Gamble_Type = 2";
		$arrSQL[2] = "update `bet_Commission` set Commission = '".$Rows -> CLine."' where MemID = ".$intDID." and Bet_Type = ".$Rows -> ID." and Gamble_Type = 3";
		foreach($arrSQL as $strSQL){
			if(!PMA_mysql_query($strSQL, $_ConnMaster)){
				exit("Error".PMA_mysql_error($_ConnMaster));
			}	
		}
	}
}
?>OK